Skip to content

task completed#2425

Open
droopy-bit wants to merge 3 commits into
mate-academy:masterfrom
droopy-bit:develop
Open

task completed#2425
droopy-bit wants to merge 3 commits into
mate-academy:masterfrom
droopy-bit:develop

Conversation

@droopy-bit

Copy link
Copy Markdown

@etojeDenys etojeDenys left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job, just a few fixes:

  1. split app into several components

Comment thread src/App.tsx Outdated
export const App: React.FC = () => {
const [todos, setTodos] = useState<Todo[]>([]);
const [errorMessage, setErrorMessage] = useState('');
const [filter, setFilter] = useState<'all' | 'active' | 'completed'>('all');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to create an enum for the filter parameters

Comment thread src/App.tsx Outdated
getTodos()
.then(setTodos)
.catch(() => {
setErrorMessage('Unable to load todos');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create an enum for errors as well

Comment thread src/App.tsx Outdated
Comment on lines +106 to +126
<a
onClick={() => setFilter('all')}
href="#/"
className={
filter === 'all' ? 'filter__link selected' : 'filter__link'
}
data-cy="FilterLinkAll"
>
All
</a>

<a
onClick={() => setFilter('active')}
href="#/active"
className={
filter === 'active' ? 'filter__link selected' : 'filter__link'
}
data-cy="FilterLinkActive"
>
Active
</a>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can create an array with the required parameters and then map through it to create links and avoid code repetition

@droopy-bit droopy-bit requested a review from etojeDenys July 6, 2026 21:15

@brespect brespect left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants